﻿Imports System.Text.RegularExpressions
Imports System.Web
Imports System.Runtime.CompilerServices

Module ExtensionModule

    <Extension()> _
    Public Function DecodeValue(ByVal group As Group) As String

        Dim text = group.Value.Replace(vbCrLf, "").Replace("<br />", vbCrLf)
        text = HttpUtility.HtmlDecode(Regex.Replace(text, "<.*?>", "", RegexOptions.Singleline))
        Return Regex.Replace(text, "(\r\n)+", vbCrLf).Trim

    End Function
End Module
